#ifndef STORE_H_
#define STORE_H_
//=====================================You can add code here=========================================
#include<iostream>
using std::string;
#include <set>
using std::set;
#include "Album.h"
#include "Customer.h"
//===================================================================================================

class Store {
//=====================================You can add code here=========================================

//===================================================================================================
public:
	static const int currentYear = 2013;
	Store();
	void addAlbum(int barcode, int price, int year, int numPurchased, string title, string artist);
	void removeAlbum(int barcode);
	void addCustomer(int id, string name);
	void createNewOrder(int id, int ordNum);
	void addToOrder(int ordNum, int barcode);
	void removeFromOrder(int ordNum, int barcode);
	void payOrder(int ordNum);
	string getRecommendations(int numOfRecommendations) const;
	string getInventoryReport() const;
	string getCustomersReport() const;
	string getCustomerReport(int id) const;
	string getRevenueReport() const;
	~Store();
//=====================================You can add code here=========================================
private:
	/**
	 * A struct which holds a pair of order id and customer id,
	 * used to map between orders and customers inside the store.
	 */
	struct OrderCustomerPair {
		OrderCustomerPair(int orderId, int customerId);
		OrderCustomerPair(int orderId);
		const int orderId;
		const int customerId;
	};

	/**
	 * Implements operator < for OrderCustomerPair, so while using it in a set,
	 * comparisons will be made using the order id.
	 */
	friend bool operator<(const OrderCustomerPair& pair1,
			const OrderCustomerPair& pair2);

	set<Album, Album::SortByBarcode> inventory;
	set<Customer, Customer::SortById> customers;
	set<OrderCustomerPair> orderCustomerMap;
	int revenue;
	int albumsPurchased;

	set<Album>::iterator getAlbumByBarcode(int barcode) const;
	set<Customer>::iterator getOrderOwner(const Order& order) const;
	void verifyAlbumsExist(const List<Album>& albums) const;
	void updateAfterAlbumPurchased(const Album& album);
//===================================================================================================
};

#endif /* STORE_H_ */
